from time import sleep

from appium.webdriver.common.appiumby import AppiumBy

from base.base_page import BasePage


class PageMiNewArrivals(BasePage):

    def new_arrivals_calendar_goto_shopping_cart(self):
        """
        新到达商品-选择商品-添加购物车-去购物车
        :return: 购物车页面
        """
        from page.page_shopping.page_sevice_shopping import PageShopping
        choice_locator = "new UiSelector().text(\"REDMI K90 Pro Max\")"
        calendar_locator = "new UiSelector().className(\"android.view.View\").instance(2)"
        self._click(choice_locator)
        self._click(calendar_locator)

        sleep(2)
        return PageShopping()

    def new_product_list_goto_shopping_cart(self):
        pass

